﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class admin_delNews : System.Web.UI.Page
{
    db_news news = new db_news();
    protected void Page_Load(object sender, EventArgs e)
    {
        Server.Execute("inc/checkPurview.aspx");  // 此处用户权限验证
        string news_ID = Request.QueryString["id"];
        //通过验证控件的验证
        if (news_ID != null)
        {
            if (news.delNews(news_ID))
            {
                delOKInfo.Text = "删除成功！！！";
                Response.Write("<script language=javascript>alert('删除成功！');location.href='manageNews.aspx';</script>");
                //Response.Redirect("~/admin/manageNews.aspx");
                //server.transfer
                //Server.Transfer("~/admin/manageNews.aspx");
            }
            else
            {
                Response.Write("<script language=javascript>alert('删除失败！');location.href='manageNews.aspx';</script>");
            }

        }
        else
        {
            Response.Redirect("manageNews.aspx");
        }
    }
}